package com.doudi.product;

public class InsertSql {
	public static String generateSql(String str, int tableCount) {
		String[] strArr = str.trim().replace("\t", " ").split(" ");
		int pid = Integer.valueOf(strArr[0]);
		int price = Integer.valueOf(strArr[1]);
		String detail = strArr[2];
		int count = Integer.valueOf(strArr[3]);
		String table = "product_" + pid % tableCount;
		return "insert into " + table + " values(" + pid + "," + price + ",\'" + detail + "\'," + count + ");";
	}
}
